package com.devsoft.foodfrenzy;

public class SocialMediaManager {
	/*
	public void facebookLogin() {
		Session.openActiveSession(this, true, new Session.StatusCallback() {   
		@Override
		public void call(Session session, SessionState state, Exception exception) {
		        if (session.isOpened()) {
		        Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {
		                @Override
		                public void onCompleted(GraphUser user, Response response) {
		                        if (user != null) {
		                        // CALLBACK: USER IS LOGGED IN
		                        // DO YOUR STUFF HERE
		                        // e.g. fbUsername = user.getFirstName();
		                        // this will save the users first name to a public variable fbUsername
		                        }
		                }
		        });
		        }
		}
		});
		}
	
	public void facebookFeedDialog(String pRecord, int fLevel) {
		Bundle params = new Bundle();
		params.putString("name", fbUsername + " achieved a new High Score on" + " Level: " + fLevel + " Score: " + pRecord);
		params.putString("caption", "Food Frenzy");
		params.putString("description", "Help Panda Chef catch all the food!");
		 
		WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(this, Session.getActiveSession(), params)).setOnCompleteListener(new OnCompleteListener() {
		        @Override
		        public void onComplete(Bundle values, FacebookException error) {
		                if (error == null) {
		                        final String postId = values.getString("post_id");
		                        if (postId != null) {
		                        // POSTED
		                        } else {
		                        // POST CANCELLED
		                        }
		                } else if (error instanceof FacebookOperationCanceledException) {
		                        // POST CANCELLED
		                        } else {
		                        // ERROR POSTING
		                        }
		                }
		}).build();
		feedDialog.show();
		}
*/
}
